//
//this file needs to be PHPed so that it takes the time from the server, and updates that.
//

function getTime(h,m,s)
{
	return ""+h+":"+m+":"+s;
}	
<?php 
echo 'var date = new Date();';
echo 'date.setFullYear('.date("Y,n,d").');';
echo 'date.setMonth('.date("n").'-1);';
echo 'date.setHours('.date("G,i,s") .');';//this is php hardcoding the start date.
?>
function time() 
{
	//alert(date);
	//Seconds

	date.setSeconds((date.getSeconds()) + 1);	
	if(date.getSeconds() == 60)
	{
		date.setSeconds(0);
		date.setMinutes( date.getMinutes() +1);

		if(date.getMinutes() == 60)
		{
			date.setMinutes(0);
			date.setHours(date.getHours()+1);
		}
	}

	

	hour= date.getHours();
	min= date.getMinutes();
	sec= date.getSeconds();	

	if (min<=9) {
		min="0"+min;
	}
	if (sec<=9) {
		sec="0"+sec;
	}
	if (hour>12) {
		hour=hour-12;
		add="pm";
	}else{
		hour=hour;
		add="am";
	}
	if (hour==12) {
		add="pm";
	}

	var temp = hour+":"+min+":"+sec+" "+add;

	document.getElementById('time').innerHTML = '<center>'+temp+'</center>';
	setTimeout("time()", 1000); 
} 

